﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web.UI.HtmlControls;
using System.Web.UI;
using System.Web;
using System.Net;


using DevExpress.Web.ASPxHeadline;

using LMD.Lib.DataClass;
using LMD.Constant;
using LMD.Lib.Interface;
using LMD.Lib.Oracle;
using LMD.Lib.Controls;

/// <summary>
/// Summary description for GridColumnManager
/// </summary>
public static class GridColumnManager
{
    public static String GetDownloadLinkColumn(String sxId, String sxFileName)
    {
        String sxOutput = String.Empty;
        if (!String.IsNullOrEmpty(sxId))
        {
            sxOutput = CustomControls.Create_DownloadLinkForGrid(Convert.ToInt32(sxId), sxFileName);
        }
        return sxOutput;
    }
	public static String GetDownloadLinkColumn2(String sxId, String sxFileName, String sxType)
    {
        String sxOutput = String.Empty;
        String sxPath = String.Empty;

        if (!String.IsNullOrEmpty(sxId) && !String.IsNullOrEmpty(sxFileName))
        {
            if (sxType.ToUpper().Equals("AUTO"))
            {
                sxPath = "http://10.24.19.71" + sxFileName.Substring(1, sxFileName.Length - 1);
                //sxOutput = String.Format("<a class=\"lnkless\" onclick=\"{0}\">{1}</a>",
                sxOutput = String.Format("<div class=\"lnkless\" onclick=\"javascript:window.open('{0}');\">{1}</div>",
                        sxPath,
                        sxPath);
            }
            else
            {
                sxOutput = CustomControls.Create_DownloadLinkForGrid(Convert.ToInt32(sxId), sxFileName);
            }
        }
        return sxOutput;
    }
    public static String GetCARLinkColumn(String sxId, String sxCAR)
    {
        String sxOutput = String.Empty;
        sxOutput = String.Format("<a class=\"lnkless\" href=\"NewsFeed.aspx?mode=profile&uid={0}\">{1}</a>",
            sxId,
            sxCAR);
        return sxOutput;
    }
    public static String GetCompanyLinkColumn(String sxId, String sxCompanyName)
    {
        String sxOutput = String.Empty;
        sxOutput = String.Format("<a class=\"lnkless\" href=\"CompanyProfile.aspx?cid={0}\">{1}</a>",
            sxId,
            sxCompanyName);
        return sxOutput;
    }
}
